﻿using System;

class CatalanNumbers
{
    static decimal Factorial(int number)
    {
        decimal factorial = 1;
        for (int i = number; i > 1; i--)
        {
            factorial = factorial * i;
        }
        return factorial;
    }

    static void Main()
    {
        Console.Write("Enter an integer number to calculate its Catalan value: ");
        string consoleInput = Console.ReadLine();
        int n;
        int.TryParse(consoleInput, out n);
        decimal result = 0;

        result = Factorial(2 * n) / (Factorial(n + 1) * Factorial(n));
        Console.WriteLine("The value of the Catalan number [{0}] is: {1}", n, result);
    }
}
